<canvas id="teacherChart" width="150" height="150"></canvas>
<script>
    $(function () {
        var ctx = document.getElementById("teacherChart").getContext('2d');
        var myChart = new Chart(ctx, {
            type: 'bar',
            data:{
                labels: ["50后","60后", "70后", "80后", "90后"],
                datasets: [
                    {
                        label: "男教师",
                        data: [{{ $teacherNanArr }}],
                        backgroundColor: 'rgba(88, 126, 183, 0.5)'
                    },
                    {
                        label: "女教师",
                        data: [{{ $teacherWomanArr }}],
                        backgroundColor: 'rgba(206, 76, 146, 0.5)'
                    }
                ]
            }
        });
    });
</script>